import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.config.productionTip = false
Vue.use(Vant);

// ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

router.beforeEach((to, from, next) => {
  if (to.name) {
    let isBack = to.meta.isBack == false ? false : true
    store.commit("setHeader", { title: to.meta.title, isBack: isBack });
    next();
  } else {
    router.replace({ name: "404" });
  }
});
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
